import App from './App'
import store from './store'
// #ifndef VUE3
import Vue from 'vue'
import httpServer from './store/ajax.js'
import mixin from './store/mixin.js'
import url from './store/config.js'
import navTo from './common/navTo.js'
import navLink from './common/navLink.js'
import navPublic from "@/components/navPublic.vue"
import pPop from "@/components/p-pop.vue"
import p2Pop from "@/components/p2-pop.vue"
import codePop from "@/components/code-pop.vue"
import './uni.promisify.adaptor'
Vue.component("nav-public",navPublic);
Vue.component("p-pop",pPop);
Vue.component("p2-pop",p2Pop);
Vue.component("code-pop",codePop);
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
const msg = (title, duration = 3000, mask = false, icon = 'none') => {
	//统一提示方便全局修改
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}
Vue.prototype.$axios = httpServer;
Vue.prototype.$navTo = navTo;
Vue.prototype.$navBack = navLink.navBack;
Vue.prototype.$url = url;
Vue.prototype.$navRed = navLink.navRed;
Vue.prototype.$navNew = navLink.navNew;
Vue.prototype.$navHome = navLink.navHome;
Vue.prototype.$store = store;
Vue.prototype.$api = {
	msg
};
Vue.mixin(mixin);
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif